package com.xiangxiao.rpan.utils;

/**
 * 密码工具类
 * @auther xiangxiao
 * @email 573768011@qq.com
 * @data 2022/12/29 17:14
 */
public class PasswordUtil {
  /**
   * 随机生成盐值
   *
   * @return
   */
  public static String getSalt() {
    return MD5Util.encode(UUIDUtil.getUUID());
  }

  /**
   * 密码加密
   *
   * @param salt
   * @param inputPassword
   * @return
   */
  public static String encryptPassword(String salt, String inputPassword) {
    return MD5Util.encode(MD5Util.encode(inputPassword) + salt);
  }
}
